// import Vue from 'vue';
// import Vuex from 'vuex';

// Vue.use(Vuex);

const state = () => ({
  itemTitle: 'DetailPage',
  itemDate: '2021-10-31',
});

const mutations = {
  modifyItemTitle(state, payload) {
    state.itemTitle = payload;
  },
  modifyDate(state,payload){
    state.itemDate = payload
  }
};

// 存在异步操作使用action，直接调用mutation中的函数
const actions = {
  modifyDate(context,payload) {
    context.commit('modifyDate',payload)
  }
}

export default {
  state,
  mutations,
  actions,
}